import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 班组 - 下拉框
export const getGroupList = params =>
  axios.get(`/api/sysManage/basedata/users/getUserAndWorkGroup`, {
    params
  });
// 获取班组名称
export const getWorkGroupNameByWorkId = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/repairAssign/getWorkGroupNameByWorkId`, { params });
// 结算查询
export const getQueryAccounts = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryAccounts`, { params });
// 查询台次
export const getQueryEnterSituationNum = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryEnterSituationNum`, { params });
// 车牌汇总
export const getQueryEnterSituationByLicense = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryEnterSituationByLicense`, { params, timeout: 60000 });
// 预约率查询
export const getQueryEnterSituationBooking = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryEnterSituationBooking`, { params });
// 查询结账 getQuerySettlement
export const getQuerySettlement = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQuerySettlement`, { params, timeout: 300000 });
// 打印数据
export const getSettlement = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getSettlement`, { params });

export const getStatistics = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getStatistics`, { params });

// 查询结算记录
export const getQueryAccountsModel = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryAccountsModel`, { params });
// 查询取消结算信息
export const getOutQueryAccountsModel = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getOutQueryAccountsModel`, { params });

// 12.7进厂查询
// 进厂查询主页面
export const getQueryEnterSituation = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryEnterSituation`, { params, timeout: 60000 });
// 查询误点信息
// export const getQueryWudian = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/queryAccounts/getQueryWudian`, { params });
export const getQueryWudian = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getgetQueryEnterSituationDetail`, { params });
// 查询台账
export const getLedger = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getLedger`, { params });
// 查询车型总汇
export const getVehicleConfluence = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getVehicleConfluence`, { params });
// 查询车牌总汇
export const getPlateConfluence = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getPlateConfluence`, { params });
// 查询准时交车率
export const getOnTimeDelivery = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getOnTimeDelivery`, { params });
// 查询预约率查询-委托书
export const getInquiryAttornery = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getInquiryAttornery`, { params });
// 预约率 车辆
export const getContactMange0 = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getContactMange0`, { params });
// 查询临近准时交车率
export const getContactMange1 = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getContactMange1`, { params });
// 钣喷快修交车率
export const getContactMange3 = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getContactMange3`, { params });
// 机修快保交车率
export const getContactMange4 = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getContactMange4`, { params });
// 查询结算记录
// export const getQueryAccountsModel = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/queryAccounts/getQueryAccountsModel`, { params });
// 车辆维修信息统计
export const getCarRepairThing = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getCarRepairThing`, { params, timeout: 600000 });
// 项目领料-项目
export const queryProjects = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/queryProjects`, { params });
// 项目领料-备件
export const querySparePart = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/querySparePart`, { params });
// 客户车辆明细
export const getCustomerVehicleDetails = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getCustomerVehicleDetails`, { params });
// ikey故障
export const getIkeyFault = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getIkeyFault`, { params });
// 流失客户
export const getCustormer = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getCustormer`, { params, timeout: 600000 });
// 流失客户回访
export const getCustomerChurnBack = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getCustomerChurnBack`, { params });

// 查询接车单
export const getQueryPickUpOrder = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryPickUpOrder`, { params });
// 流程时长统计(上)
export const getTechnologicalPorcessHours = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getTechnologicalPorcessHours`, { params });
// 流程时长统计(下)
export const getPorcessHoursDown = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getPorcessHoursDown`, { params });

// 工位利用率
export const getStationUtilize = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getStationUtilize`, { params });
// 工时统计查询
export const getHoursStatistics = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getHoursStatistics`, { params });
// 查询全部前台领料
export const getQueryAllMaterial = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryAllMaterial`, { params });
// 查询估算委托书
export const getQueryEstimateEntrust = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryEstimateEntrust`, { params });
// 车辆维修信息统计
// export const getQueryCarMaintain = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/queryAccounts/getQueryCarMaintain`, { params });

// 项目材料明细-项目
export const getXM = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getXM`, { params });
// 项目材料明细-备件
export const getPJ = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getPJ`, { params });
// 项目材料明细-建议项目
export const getJYXM = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getJYXM`, { params });

// 操作员、录入人(售前提供的接口)
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 收入统计--营业报表
export const getBusinessStatement = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getBusinessStatement`, { params });
// 收入统计--营业报表获取打印数据
export const getPrinter = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getPrinter`, { params });

// 收入统计:在厂车日动态
export const getFactoryCarDailyData = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getFactoryCarDailyData`, { params });
// 收入统计--收入汇总
export const getIncomeSummary = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getIncomeSummary`, { params });
// 收入统计--销售顾问业绩统计 (旧)
export const getServiceAdciserData = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getServiceAdciserData`, { params });
// 收入统计--销售顾问业绩统计
export const searchServiceAdvisor = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/searchServiceAdvisor`, { params });
// 收入统计--生产统计
export const getProductionStatistics = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getProductionStatistics`, { params });
// 收入统计--服务范围汇总
export const getServiceRangeSummary = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getServiceRangeSummary`, { params });
// 维修综合情况统计
export const getRepairTotal = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getRepairTotal`, { params });
// 接车单打印
export const getQueryPickUpOrderPrint = (jcNo, params) => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getQueryPickUpOrderPrint/${jcNo}`, { params });
// 电子化
export const receptionOrder = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/createPrintPdf/receptionOrder`, { params });
// 电子化
export const roPrintPdf = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/createPrintPdf/roPrintPdf`, { params });
// 班组下拉选
export const queryWorkGroup = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/basedata/workgroups/queryWorkGroup`, { params });

// 业务统计
export const getStatistics1 = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getStatistics1`, { params });
// 服务顾问业绩统计汇总
export const searchServiceAdvisorSum = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/searchServiceAdvisorSum`, { params });
// 工时统计汇总
export const searchWorkingHoursSum = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/searchWorkingHoursSum`, { params });

// 查询结账汇总
export const searchQuerAccontsSum = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/searchQuerAccontsSum`, { params });
// 流失客户汇总
export const getCustomerSummary = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getCustormerSummary`, { params });
// 流失客户回访汇总
export const getCustomerChurnBackSummary = params => axios.get(`${SERVER.SEARCH_DMSCLOUD_REPAIR}/queryAccounts/getCustormerChurnBackSummary`, { params });

//技师工时统计
export const getTechnicianHourReport = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/getTechnicianHourReport`, { params });

//经销商营业额汇总
export const getDealerSalesReport = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/getDealerSalesReport`, { params });

//营业收入汇总
export const getDealerReceive = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/getDealerReceive`, { params });

//客户贡献度
export const getCustomerContribution = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/getCustomerContribution`, { params });

//入场台次
export const getInCounts = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/getInCounts`, { params });

//维修人员统计日报
export const getTechnicianDayReport = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/getTechnicianDayReport`, { params });
//技师工时统计导出
export const exportTechnicianHourReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/exportTechnicianHourReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//营业收入汇总导出
export const exportDealerReceive = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/exportDealerReceive`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//客户贡献度导出
export const exportCustomerContribution = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/exportCustomerContribution`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//入场台次导出
export const exportInCounts = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/exportInCounts`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
//维修人员统计日报导出
export const exportTechnicianDayReport = params => {
  return axios({
    url: `${SERVER.DMSCLOUD_REPAIR}/order/repairOrderReport/exportTechnicianDayReport`,
    method: 'get',
    params: params,
    responseType: 'blob'
  });
};
